package com.ylfstu.innerclass;

public class LocalInnerClass {
    public static void main(String[] args) {
        Outer01 outer01 = new Outer01();
        outer01.m1();
    }
}

class Outer01 {//外部类
    private int n1 = 100;

    public void m2() {
        System.out.println("Outer m2");
    }

    public void m1() {//方法
        //局部内部类是定义在外部类的成员位置，比如方法中，并且有类名
        class inner01 {//局部内部类
            private int n1 = 888;
            public void f1() {
                System.out.println("n1= " + n1 + "outer类n1= " + Outer01.this.n1);
                m2();
            }
        }
        inner01 inner01 = new inner01();
        inner01.f1();
    }
}